package model.bean;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

@Entity
@Table(name = "v_modulo")
public class Modulo {
	@Id
	@Column(name = "id_modulo")
	private Long id;
	@Column(name = "nome")
	private String nome;
	@Column(name = "carga_horaria")
	private int cargaHoraria;
	@Column(name = "perfil_entrada")
	private String perfilEntrada;
	@Column(name = "perfil_saida")
	private String perfilSaida;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_curso")
	@Fetch(FetchMode.SELECT)
	private Curso curso;

	@OneToMany(mappedBy = "modulo", fetch = FetchType.LAZY)
	private List<Turma> turmas;

	public Long getId() {
		return id;
	}

	
	public void setId(Long id) {
		this.id = id;
	}


	public String getNome() {
		return nome;
	}

	public int getCargaHoraria() {
		return cargaHoraria;
	}

	public String getPerfilEntrada() {
		return perfilEntrada;
	}

	public String getPerfilSaida() {
		return perfilSaida;
	}

	public Curso getCurso() {
		return curso;
	}

	public List<Turma> getTurmas() {
		return turmas;
	}

}
